<html>
  <head>
    <title>ConArtist - Stores</title>
    <link rel="stylesheet" type="text/css" href="style.css" />
  </head>
  <body>
    <h1>ConArtist - Stores</h1>
<p>ConArtist is designed to allow content to be stored in a number of different mechanisms. In order to make using these different storage mechanisms usable a common interface is supplied.</p>
<h2>Anatomy of a Store</h2>
<p>Each store object deals with content from a single resource. They are stored in a global manner and pointers to the object are stored by the various sites that use them.</p>
<p class="centred">
  <img src="stores1.png"/>
</p>
<p>By using such an arrangement we reduce the overhead required by the application and move all the logic required for the stores into the stores object.</p>
<h3>Finding a Store</h3>
<p>As each store will have both a type and location these will be used to find the desired store. This avoids the requirement to have a unique names which would increase the configuration overhead.</p>
<h3>Types of Store</h3>
<p>The basic store functionality will be builtin to the core library, but additional types of stores will be available through dymanically loaded modules. Each type will be identified by a unique name.</p>
<h3>Accessing Store Content</h3>
<p>It is assumed that the stores content will be organised as files, so the main methods to access data are based around that idea. That said, there is no reason why stores that access databases could not be developed.</p>
<h3>Logical vs Physical</h3>
<p>Each store is independant of the site that is trying to access it which means that discovering the path to a file within the store directly isn't possible, nor should it be.</p>
<p>const char *storeGetPath(const char *subpath) will return the full path to a file specified by a subpath. This assumes that the site has done any required adjustments to the URL it was passed. e.g.</p>
<p class="italic">A request for /foo/bar/index.html is received by a site that is mounted at /foo/. When asking the store for the file the subpath would be /bar/index.html.</p>
<h3>Multiple Stores</h3>
<p>When a site has multiple stores there needs to be some way of determining which store is the correct one for a particular file. Presently it is envisaged that each store within a site be named and that the name be prepended to the desired path when requested, e.g.
<p class="italic">foo:/bar/index.html would mean the file '/bar/index.html' within the store named 'foo'.</p>
<p>As the stores are global objects the names would only apply to the individual site, allowing a high degree of control and avoiding problems with namespace collisions.</p>
  </body>
</html>
